package xyz.syyrjx.registry.conf;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import xyz.syyrjx.entity.SyyrjxRpcRemoteAddress;

/**
 * @author 大地崩坏苍蝇兽
 * @date 2023/1/14 - 18:52
 */
@ConfigurationProperties("xyz.syyrjx.rpc.registry")
@Data
public class SyyrjxRpcRegistryConfiguration {

    private String host = "localhost";

    private int port;

    private int maxReadSize = 4 * 1024;

    private int microSecondsToDead = 45000;
    
    private String[] registryAddress;

    private static SyyrjxRpcRemoteAddress local;

    private static SyyrjxRpcRegistryConfiguration configuration;


    public static SyyrjxRpcRemoteAddress getLocal() {
        return local;
    }

    public static void setLocal(SyyrjxRpcRemoteAddress local) {
        SyyrjxRpcRegistryConfiguration.local = local;
    }

    public static SyyrjxRpcRegistryConfiguration getConfiguration() {
        return configuration;
    }

    public static void setConfiguration(SyyrjxRpcRegistryConfiguration configuration) {
        SyyrjxRpcRegistryConfiguration.configuration = configuration;
    }
}
